#ifndef TICTACTOE_H
#define TICTACTOE_H

#include <QWidget>
#include <QPushButton>
#include <QTimer>
#include <QString>
#include <QVector>
#include "widget.h"
#include "mainwindow.h"
class Widget;
class MainWindow;

class TicTacToe : public QWidget
{
    Q_OBJECT

public:
    explicit TicTacToe(QWidget *parent = nullptr);
    ~TicTacToe();
    void buttonClicked();

    QString getRecognitionState();
    void updateBoardUI();
    void makeAIMove();
    bool checkWin(int player);
    bool isBoardFull();
    void resetGame();
    int findBestMove();
    void mapToArmCoords(int row, int col, int &x, int &y, int &z);

private slots:
    void checkRecognitionChanges();
    //void buttonClicked(); // Commented out in the .cpp

private:
    QPushButton* buttons[9];
    int board[9];
    int currentPlayer;
    QPushButton* ResetButton;
    QTimer* recognitionCheckTimer;
    QString previousRecognitionState;
    Widget w;
    MainWindow ww;
};

#endif // TICTACTOE_H
